import axios from 'axios'
// import { Toast } from 'vant'
// import NProgress from 'nprogress'
// import 'nprogress/nprogress.css'
axios.defaults.baseURL = 'http://127.0.0.1:3000'
axios.interceptors.request.use(function (config) {
  // NProgress.start()
  return config
}, function (error) {
  return Promise.reject(error)
})

axios.interceptors.response.use(function (response) {
  // NProgress.done()
  return response.data
}, function (error) {
  // Toast(error.message)
  return Promise.reject(error)
})

export default axios